//
//  Student.m
//  OC02_方法
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "Student.h"

@implementation Student

/** 重写父类方法 */
- (void)study {
    
    [super study];  // 注意: super不是对象, 是编译器指令, 给super发消息, 可以执行父类该方法的实现
    NSLog(@"数学");
    
}

- (void)setSchool:(NSString *)school {
    
    _school = school;
}
- (NSString *)school {
    return _school;
}


- (void)setNumber:(int)number {
    _number = number;
}

- (int)number {
    return _number;
}

/** 自定义初始化方法 */
- (instancetype)initWithName:(NSString *)name
                         age:(NSInteger)age
                         sex:(NSString *)sex
                      school:(NSString *)school
                      number:(int)number {
    self = [super initWithName:name age:age sex:sex];
    if (self) {
        _school = school;
        _number = number;
    }
    return self;
}


















@end
